package com.lbloca.locate.weight;

import android.content.Context;
import android.graphics.Bitmap;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.transition.Transition;
import com.lbloca.locate.R;


public class MeInfoView extends RelativeLayout {
    private ImageView imgIcon;
    private TextView tvTitle;
    private View line;

    public MeInfoView(Context context) {
        this(context, null);
    }

    public MeInfoView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public MeInfoView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onFinishInflate() {
        imgIcon = findViewById(R.id.img_icon);
        tvTitle = findViewById(R.id.tv_title);
        line = findViewById(R.id.line);
        super.onFinishInflate();
    }

    public void setViewTitle(CharSequence text) {
        if (tvTitle != null)
            tvTitle.setText(text);
    }

    public void setViewTitle(int resId) {
        if (tvTitle != null)
            tvTitle.setText(resId);
    }

    public void setViewIcon(int resId) {
        if (imgIcon != null)
            imgIcon.setImageResource(resId);
    }

    public void setLineVisibility(int visibility) {
        if (line != null)
            line.setVisibility(visibility);
    }
}
